package com.greateamd.timetableasy.client.services.user;

import java.util.Date;
import java.util.List;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.greateamd.timetableasy.client.domain.AuthType;
import com.greateamd.timetableasy.domain.Event;
import com.greateamd.timetableasy.domain.User;

public interface UserServiceAsync {

	void find(String username, AsyncCallback<User> asyncCallback);
	void remove(User user, AsyncCallback<Boolean> asyncCallback);

	void update(User user, AsyncCallback<Boolean> asyncCallback);
	void addEvent(Event event, AsyncCallback<Boolean> asyncCallback);

	/**
	 * Return all user found in database
	 * @param asyncCallback list of users
	 */
	void getAll(AsyncCallback<List<User>> asyncCallback);
	/**
	 * Return all user with the CampusManager role found in database
	 * @param asyncCallback list of users
	 */
	void getAllCampusManager(AsyncCallback<List<User>> callback);
	/**
	 * Return all user without promotion (new user ?) found in database
	 * @param asyncCallback list of users
	 */
	void getUserWithoutPromotion(AsyncCallback<List<User>> callback);
	void getAllTeachers(AsyncCallback<List<User>> asyncCallback);
	
	void save(User user, AsyncCallback<Boolean> callback);
	void getPlanning(User user, Date from, Date to,AsyncCallback<List<Event>> asyncCallback);
	void getTeacherPlanning(User user, Date fromDate, Date toDate,AsyncCallback<List<Event>> asyncCallback);
	
	void removeUserAuth(User user, AuthType auth, AsyncCallback<Boolean> callback);
	void addUserAuth(User user, AuthType auth, AsyncCallback<Boolean> callback);
	
	void getTeacherDisponibility(Integer excluseThisEventId,String teacherUsername, Date from, int duration,AsyncCallback<Boolean> callback);
}
